<template>
  <div class="flex flex-center page-style">
    <div v-if="isLoggedIn === null">Загрузка</div>
    <component
      :is="
        isLoggedIn === true ? 'IsAuth' : isLoggedIn === false ? 'NotAuth' : ''
      "
    />
  </div>
</template>

<script>
import { mapState } from "pinia";
import { useAuthStore } from "src/stores/auth";
import { defineAsyncComponent, defineComponent } from "vue";

export default defineComponent({
  name: "PageIndex",
  data() {
    return {
      confirm: true,
    };
  },

  components: {
    IsAuth: defineAsyncComponent(() => import("../components/IsAuth.vue")),
    NotAuth: defineAsyncComponent(() => import("../components/NotAuth.vue")),
  },
  computed: {
    ...mapState(useAuthStore, ["isLoggedIn"]),
  },
});
</script>
<style scoped></style>
